updated encoder