added linear rate

and also did some bug fixes