added code from googlegames