add second part of problem 1, add first methods to problem 2