Added a basic cache mechanism