Code for CasualMetricBot