Accretion of planets