Edited the isDefined function to account for the possibility of numbers being passed in