input handling fully functional