private String doNext(boolean remove, int lookAhead) {			
			prevPos = pos;
			
			String res = null;
			for (int i = 0; i < lookAhead; i ++) {
				if (pos == str.length()) {
					throw new IllegalStateException("End of stream");
				}
				
				StringBuilder tmp = new StringBuilder();			
				String c = read();
				if (isSpecial(c)) {
					tmp.append(c);
					pos ++;
				} else {
					while (pos < str.length() && !isSpecial(c = read())) {				
						tmp.append(c);
						pos ++;
					}
				}
											
				for (; pos < str.length() && isSpace(c = read()); pos ++); //skip spaces if any
				
				res = tmp.toString();
			}
											
			if (!remove) {
				pos = prevPos;
			}
			
			return res;
		}