refactored the statistical brush function and the zoom function