added extra control to memory allocation mechanisms