working on edist
edit dist func
almost done
finished debugging