private function generateInitials()
    {
	    $nameOrInitials = trim($this->name);

    	if( !$this->keepCase ) {
		    $nameOrInitials = mb_strtoupper($nameOrInitials);
	    }

        $names = explode(' ', $nameOrInitials);
        $initials = $nameOrInitials;
        $assignedNames = 0;

        if (count($names) > 1) {
            $initials = '';
            $start = 0;

            for ($i = 0; $i < $this->length; $i++) {
                $index = $i;

                if (($index === ($this->length - 1) && $index > 0) || ($index > (count($names) - 1))) {
                    $index = count($names) - 1;
                }

                if ($assignedNames >= count($names)) {
                    $start++;
                }

                $initials .= mb_substr($names[$index], $start, 1);
                $assignedNames++;
            }
        }

        $initials = mb_substr($initials, 0, $this->length);

        return $initials;
    }