factored out gamespeed