Memory cleanup implemented