Output state functionality added.