Added input handling.