Finished mem modify function.