revised clock code