test code to calculate drift rate.