Moved word count vars back into function. Broke when outside of function.