public function getElement($name, $offset = null, &$pieceOfPath = null)
    {
        
        if (StringUtils::beginsWith("this.", $name)) {
            $name = substr($name, 5);
        }
        
        if (null!==$offset) {
            if ($offset<0) {
                throw new BadParameterException("\$offset can't be negative. ".$offset." given");
            }

            $lastPath="";
            while ($offset>0) {
                $lastDot= strrpos($name, ".");
                $lastPath=substr($name, $lastDot+1).".".$lastPath;
                $name=substr($name, 0, $lastDot);
                $offset--;
            }

            if (""===$name) {
                throw new \Face\Exception\RootFaceReachedException("Offset was too deep and reached root face");
            }


            $lastPath=rtrim($lastPath, ".");
            $pieceOfPath[0]=$name;
            $pieceOfPath[1]=$lastPath;


        }
        
        
        if (false!==strpos($name, ".")) {
            $firstChildFace = $this->getElement(strstr($name, ".", true))->getFace();
            return $firstChildFace->getElement(trim(strstr($name, "."), "."));
        }
        
        if (!isset($this->elements[$name])) {

            throw new FaceElementDoesntExistsException($name, $this);
        }


        return $this->elements[$name];
    }