refactored .contain? to make more efficient