public boolean isPalindrome(String s) {
        
    	if(s.isEmpty()) {
    		return true;
    	}
    	
    	int head = 0;
    	int tail = s.length() - 1;
    	
    	s = s.toLowerCase();
    	while(head < tail) {
    		
    		while(head < s.length() && !Character.isLetterOrDigit(s.charAt(head))) {
    			head++;
    		}
    		while(tail >= 0 && !Character.isLetterOrDigit(s.charAt(tail))) {
    			tail--;
    		}
    		
    		// this line is cool
    		if(head == s.length() || tail == -1) break;
    		
    		if(s.charAt(head) == s.charAt(tail)) {
    			head++;
    			tail--;
    		} else {
    			return false;
    		}
    	}
    	return true;
    }