Problem 7 solved.
Tests for problem 7 added.