Shortening the paths