added caching to be used to limit i/o writes later on