added memory term calculations, models, and initial simple loop.