Finished solution 4