public String convert(String s, int nRows) {
		if (nRows <= 0) return "nRows must be greater than zero";
		if (s == null) return "you need to input a string";
		
		if (nRows ==1) return s;
		
		int zigSize = 2 * nRows - 2;
		StringBuilder result = new StringBuilder();
		
		for(int i = 0; i < nRows; i ++) {
			for (int j = i; j < s.length(); j += zigSize) {
				result.append(s.charAt(j));
				
				if ( (i != 0) && (i != nRows-1) && ((j+zigSize-2*i) < s.length()) ) {
					result.append(s.charAt(j+zigSize-2*i));
				}
			}
		}
		
		return result.toString();
	}