working clock implementation