Formation of Planets in a Protoplanetary Disk