move gmop_distance() to functions file