renamed str to val for number related functions in validator