Add some helping function for calculating path length and handling collection