Delete only files which were in the cache
Fix trimming with future size
Format source code
Add tests