problem 11 and problem 12 - implemented.