Added calculation of winner and fixed game over dialog