a simulation of mechanical clock