Is this right?  Use of i->first here could be toPath or fromPath depending on reverse?