Cleaned up nextgame function

and gave credit to the rightful issuer #123