finished solution 6