corrections to the timer's frequency calculation routine