optimized add(), added cacheCode()