more relaible encoder

with somme attempt to debounce contacts