public static ArrayList<ArrayList<String>> createListFromString(String s) {
		ArrayList<ArrayList<String>> newlists = new ArrayList<ArrayList<String>>();
		// special handle, s="aaaa"
		int length = 1;
		while (length < s.length()) {
			if (!s.substring(length - 1, length).equals(
					s.substring(length, length + 1))) {
				break;
			}
			length++;
		}
		if (length == s.length()) {
			// all letters are same
			ArrayList<ArrayList<String>> newlists1 = new ArrayList<ArrayList<String>>();
			newlists1 = createListFromSameLetterString(s, newlists, s.length());
			return newlists1;
		}

		// s="abba","ababa"
		int start = 0;
		int end = s.length() - 1;
		while (start <= end) {
			ArrayList<String> newList = new ArrayList<String>();
			if (newlists.size() != 0) {
				if (newlists.size() > 0) {
					int disL = start - 1;
					int disR = end + 1;
					while (disL > 0) {
						String lastEdge = newlists.get(newlists.size() - 1)
								.get(disL - 1);
						newList.add(lastEdge);
						disL--;
					}
					newList.add(s.substring(start - 1, start));
					newList.add(s.substring(start, end + 1));
					newList.add(s.substring(start - 1, start));
					disL = start - 1;
					while (disL > 0) {
						String lastEdge = newlists.get(newlists.size() - 1)
								.get(disL - 1);
						newList.add(lastEdge);
						disL--;
					}
					// while(disR < s.length()){
					// String lastEdge =
					// newlists.get(newlists.size()-1).get(disR+1);
					// newList.add(lastEdge);
					// disR++;
					// }
					newlists.add(newList);
				}
			} else {
				newList.add(s.substring(start, end + 1));
				newlists.add(newList);
			}
			start++;
			end--;
		}
		return newlists;
	}