got the first half of the clock algorthim worknig.