Defining the metric