change the encoder ticks reading code, back to simple 4 line version, need some test to verfiy it works