modifying the conditional logic that detects user input