Completed p3 in C