Finished solution 3.1