modified Input.java