def get_state(initial, input_value=None):
    """Get new state, filling initial and optional input_value."""
    return {
        'last_position': None,
        'initial': [initial],
        'input': [input_value] if input_value is not None else [],
        'output': [],
    }