Added some squared distance methods to aid optimization

regarding looped distance calculations