work on encoder