Added comments for future reference and replaced (hopefully) the last function not using memcache