fixed invalid access modifier on NewEncoder's destructor, and made SampleData a class so that it could have a destructor.