updated for new class encoder