Worked on encoder