checkSpelling() function created