P07 and P09 solution