A clockwork mechanism