P2 pseudocode done