Fix get Max and Min. Add new methods for get dinstences between points