Added encoders

added encoder functionality