Encoders updated

Found bug from lab 3 (diff)