Simple cache

Implemented some sort of caching mechanism.