Some work on input handling