improved output format; refactored path into a separate class; implemented uniq path calculation logic