Extended GLUS with distance functions.