code wouldn't compile, so I had to change the free method in DiscoEncoder public, rather than protected