define clock step function