moved the metric code out so we can debug better