Added statistics function