removed redundancy
make clock a local var