added metric comparison code
fixed dmetric
fixed merge issue with writing code