New code for new metric