Modified version to allow for slow motion feature