protected static void checkStatus(Block root) {
		Queue<Block> queue = new LinkedList<Block>();
		queue.add(root);
		HashSet<Block> visited = new HashSet<Block>();
		while (!queue.isEmpty()) {
			Block blk = queue.remove();
			if (blk == null || visited.contains(blk)) {
				continue;
			}
			visited.add(blk);
			if (!blk.checkIfValidStatus()) {
				throw new IllegalStateException("Block " + blk.getID() + " is not valid");
			}
			queue.add(blk.getNextBlock());
			queue.add(blk.getNegBranchBlock());
		}
	}