Finished first version of reverse routing.