More clean up. Forgot to mention in last commit: Halfway done encoder code.