Fixed encoding of blocks
Fixed computation of robot's movement.