Also has the requirement that paths is not an empty array, perhaps worth noting even if the current place calling it checks that before.