added notes on memory allocation