add docs to mem.go functions