added ending alert(that will be replaced with modal or automatic redirect to results page) and added players variable