code cleanup, change b*() to mem*()