fixed bug where r is not perfectly linear