renamed distances array