read encoder

not tested yet