Added indexes to location instance addresses.
Use the indexed lookup tables and a few other optimizations
removed unused code
not valid anymore