Bug fixing across several functions.
Added stringToNum function