Assigment 1 Part 1-2, first solution