Adding frame rate routine