Added some OUTPUT changes in do_encode to match the output of do_move and solve BTS...