1-7-13 added caching - still has a few bugs