fixed part of problem 1