wrote logic for PathChooser class - now *much* simpler while also being safer