added tests to ensure that lookup paths were being cached properly, and fixed the previous implementation