adding in memory deallocation