Changed few function parameters
Added memcatching