problem 1,2,3 tested and passed