CheckWord function added