added stop clock function and seperated updating clock and starting clock