added cached-memory code
Merge pull request #2 from vsubramaney/master

added cached-memory code