finished writing simple cortex