moved checkStringForNumbers function