Update logging and comments in encoder