working on memory allocation