added fn isValidWord