added code to calculate amount of direction drift