How to choose your friends