moved the comma checker to after removing whitespace.