comments
only cd on directory change, simplify logic