updated to scipy...cdist: speed improvement