added memory deallocation methods