enhanced general metrics computeation, ipmorted zarina's code into main project