Finished problem 3 and added problem 4