reimplement deleting paths (currently has some bugs)