Distances class writen to easily obtain nearest neighbors