public function max($key = false)
    {
        $collection = $this->getIterator();
        $max = 0;
        $valueToReturn = 0;
        foreach ($collection as $result) {
            if ($key && isset($result->$key)) {
                if ($result->$key > $max) {
                    $max = $result->$key;
                    $valueToReturn = $result;
                }
            }
            else if ($key && isset($result[$key])) {
                if ($result[$key] > $max) {
                    $max = $result[$key];    
                    $valueToReturn = $result;
                }
            }
            else {
                if ($result > $max) {
                    $max = $result;
                    $valueToReturn = $result;
                }
            }
        }
        return $valueToReturn;
    }