implemented solution 7
added test for solution 7