Added functions to handle speed

set interval and get frames per second functions