First version of cmp clock functions