Modified to work fine with my metrics