initial work on encoders (not yet working)