finished rewriting word checking