Finished the main parts of the mem library