changed c allocation and deallocation methods to c++ allocation/deallocation methods, still no progress on deletion problem