Eliminated "try" statement by testing for values as strings instead of integers