working on p30 c solution