Added clock updating subroutine