typo in spaceCount var, line 319
spaceCount var