finished solution for assigment 4.2