added encoder4