public function toList( $dir = NULL )
	{
		$array	= array();
		if( !$dir || $dir == "lwr" )
		{
			if( $this->left )
				$array = array_merge( $array, $this->left->toList( $dir ) );
			$array = array_merge( $array, array( $this->value ) );
			if( $this->right )
				$array = array_merge( $array, $this->right->toList( $dir ) );
		}
		else if( $dir == "rwl" )
		{
			if( $this->right )
				$array = array_merge( $array, $this->right->toList( $dir ) );
			$array = array_merge( $array, array ($this->value));
			if( $this->left)
				$array = array_merge( $array, $this->left->toList( $dir ) );
		}
		else if( $dir == "wlr" )
		{
			$array = array_merge( $array, array ($this->value));
			if( $this->left )
				$array = array_merge( $array, $this->left->toList( $dir ) );
			if( $this->right )
				$array = array_merge( $array, $this->right->toList( $dir ) );
		}
		else if( $dir == "wrl" )
		{
			$array = array_merge( $array, array ($this->value));
			if( $this->right )
				$array = array_merge( $array, $this->right->toList( $dir ) );
			if( $this->left )
				$array = array_merge( $array, $this->left->toList( $dir ) );
		}
		return $array;
	}