removed elementsHasClass() because it is no longer needed