added simple clock code