added p2 c solution