assignment3 with input bug