manual initalization of encoder added