re-implement the -path feature