Added reactive functions for distance