Working to correct dynamic memory control