just used the source method instead of repeatedly calling getInput()