public void run() {

		boolean stop = false;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(!stop) {

			this.printMenu();
			System.out.print("command> ");
			
			String command = "";
			
			try {
				command = br.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			if(getNumber(command) != -1) {

				String demoKey = whichDemo(getNumber(command));
				
				if (demoKey == null) {
					System.out.println("Invalid demo number " + command);
				} else {
					runDemo(demoKey);
					stop = true;	
				}				
				
			} else if ("p".equals(command)) {
				printList();
			} else if ("q".equals(command)) {			
				System.exit(-1);
			} else {
				System.out.println("Unknown command " + command);
			}			
		}
	}