encoder fixes
encoder finished