working clock

hit==TRUE code has a bug. I just set the r bit of r[prt] the algo.
requires that I set the bit of the r[hit_index]=1