Adding memory functions.