Added metrics calculations.