Added solutions for problems 5 and 6.