refactored to use a single loop, accept input args and matched up some of the metric units / stats