public String toString() {
		if (root == null) {
			return "There are no students registered";
		}

		StringBuilder sb = new StringBuilder();
		/* inorder traverse the tree */
		Stack<StudentNode> stack = new Stack<StudentNode>();
		StudentNode currentNode = root;

		while (true) {
			/* push all the left child nodes to stack */
			while (currentNode != null) {
				stack.push(currentNode);
				currentNode = currentNode.left;
			}

			if (stack.isEmpty()) {
				break;
			}

			currentNode = stack.pop();
			if(currentNode.courses.isEmpty()){
				sb.append(currentNode.name+": no courses taken\n");
			}else{
			sb.append(currentNode.name + " has taken:");
			for (String course : currentNode.courses) {
				sb.append(" " + course + ",");
			}
			/* replace last "," */
			sb.replace(sb.length() - 1, sb.length(), "\n");}

			/* traverse to right child node */
			currentNode = currentNode.right;
		}

		return sb.toString();
	}