added encoder lib