importing code from metricminer