beginning implementation of the encoder class