changed update interval according to number of samples