adding back memcache. clearing up some bits of code