remove unnecessay code and add stopwatch in modify function