array contains method and refactored win checking