finding right path implementation