Any reason this needs to do a reverse lookup and a loop in the other direction doesn't work?