simplified spellcheck function - now testable