Solved problems 3 & 4, plus added the skeleton for problem 5.