Introducing first solution to problem 1