added p 1 solution