Added clock implementation to code