I think it would be useful to implement a method that returns the first node of a path and deletes it at the same time.