Essays on network formation