imported win checking logic and win conditions constant from previous iteration