updated metrics calculation