first working version of "metrics"