Added individual word checking with function isValid