public function set(&$variable, $identifier = null)
    {
        // Generate identifier if not passed
        if (null === $identifier) {
            $identifier = sha1(serialize($variable));
        }

        // store the variable as reference
        self::$references[]          = $variable;
        $index                       = count(self::$references) - 1;
        self::$lookup[$identifier]   = $index;
        self::$reverseLookup[$index] = $identifier;

        // store count of elements
        self::$count = $index + 1;

        // return identifier for outer use
        return $identifier;
    }