Done with problems 3 and 4 in a separate file