some changes to input handling