Started implementing problem 5