added encoder to the testing branch