Added more encoder core function