fix clocking
fix bug in tracking the clock
add recovery code
Merge pull request #77 from clockfly/master

fix recovery bug