added variable declaration and a function to decide if input is a number or not