Fixed silly bug when not using abs for distance