Adding optimization for cortex