Improved use of select, still not working
Included the Caching branch