Added a statistics function and script of exemple