public Boolean isStringValid(String in) {
		//System.out.println("M " + in + " M");
		
		Boolean returnVal=Boolean.TRUE;
		if (in==null || in.length()==0) return returnVal;

		Stack<Character> stk=new Stack<Character>();
		try {
			for (Character x: in.toCharArray()) {
				if (startChars.indexOf(x)!=-1) 
					stk.push((Character)x);	
				else {
					int termIndex=endChars.indexOf(x);
					if (termIndex==-1) 
						continue;
					Character current=stk.peek();
					if (startChars.indexOf(current.charValue())==termIndex)
						stk.pop();
				}
			}	
			if (stk.empty()==false)
				returnVal=Boolean.FALSE;
		}
		catch (EmptyStackException e) {
			returnVal=Boolean.FALSE;
		}
		catch (Exception e) {
			// FIXME: weak error handling, just in case
			e.printStackTrace();
			returnVal=Boolean.FALSE;
		}
		
		return returnVal;
	}