Added hasWonHorizontal function