Some efficiencies added: caching mostly, and some tweaks to make caching work better.