added p1 c solution