Wrote merge() funct, updateDistances() lacking...