Reworked if/else with ternary operator and edited for single user input