Added an option to dissable/enable the cache. Cleaned up some code!