cleaning look-up code and making it more fail safe
3.1.4