Switch from pointers to const links
Add new fillDistanceArray function