implemented basic metric code