boolean checkSpaces(String lover) {
        char[] loverChar = lover.toCharArray();
        int spaceCount = 0;
        for (char c : loverChar) {
            if (c == ' ')
                spaceCount++;
        }
        return spaceCount <= 2 && !lover.startsWith(" ") && !lover.endsWith(" ");
    }