early code for p2 and p3 of exercise 1