Revert "improve speed of function my.dist, not much unfortunately :("

This reverts commit 5ca9a8fef24f84040e20a2ed90b103d6ef9727d4.