FIX ALL ERRORS IN P2.CPP, NOW IT CAN BE COMPILED