Implenting reverse traversal functionality