public int[] shuffle(int[] cards) {
		if(cards == null || cards.length == 0) return null;
		int[] newSeq = new int[cards.length]; // to store new order
		boolean[] moved = new boolean[cards.length]; // whether the card is moved to new deck
		
		int pos = cards.length-1, index = 0; // pos is for new deck, index is to iterate old deck
		boolean move = true; // whether we need to take current card
		while(pos >= 0) {
			if(!moved[index]) {
				if(move) {
					newSeq[pos--] = cards[index];
					moved[index] = true;
					move = false;
				} else {
					move = true;
				}
			}
			index++;
			if(index == cards.length) index = 0;
		}
		return newSeq;
	}