Heterogenous Peer Effects, Segregation and Academic Attainment