added encoder reading