add distance array