p5 solution 2 updated