Updated memory allocation- still in testing mode