created function for statistics of units