updated to import metrics earlier in code