Added input and state functionality.