Updated clock code