Compacted code, about 2 use heap to get closest pairs faster...