factor out score from playing function