Fixed the numbering of the lof.

Added message setter and current mode state machine.