Added encoder initialization