implement a clock