working on p4 c solution