forked from: Amazing Lookups Optimization

