public function insert($name, $default = null, $unique = false, $required = array())
    {
        $state = new stdClass();
        $state->name = $name;
        $state->value = pick($this->$name, $default);
        $state->unique = $unique;
        $state->required = $required;
        $state->default = $default;
        $this->_states[$name] = $state;

        //if a default value set, then try
        //set it to the state data
        if ($this->_validate($state)) {
            $this->append(array(
                $state->name => $state->value,
            ));
        }

        return $this;
    }