adding code with memory terms broken apart.