update problem 3
output 2 for problem 3