Added stats
Improved some docs, only flush cache when needed.