added hasWord and beginsWith