Added logic to detect four in a row