nClock function and fixes