made changes to mem controller