Update user_interface.c

Added a switch to replace the big, ugly if/else statement.