improved setupmetric script