made speed frame rate independent