Added hasWon function and test for that