Working Encoder 1.0

very simple aproach to encoder