loading function defined (needs modification)\nsimple distance-evaluating function defined (needs modification)