calculates players win