public void mainMenu() throws InterruptedException {
    System.out.println();
    // Tell the user options and get input
    println("Choose an option:");
    println("0: Conversions");
    println("1: Analysis");
    println("2: Element info");
    println("10: Quit");
    // Now check the option he entered
    switch (input.nextInt()) {

      case 0:
        conversionsMenu();
        break;

      case 1:
        analysisMenu();
        break;

      case 2:

        System.out.println();
        println("Enter an element:");
        String element = input.next();
        try {
          // Now try getting element info
          getElementInfo(element);

        } catch (NullPointerException e) {
          // If user entered a non-existent element, try again and get element info. If the user
          // enters
          // a nonexistent element again it will throw a IndexOutOfBounds exception.
          println("Enter a real element this time:");
          String anotherElement = input.next();
          getElementInfo(anotherElement);

        }
        Thread.sleep(5000);
        mainMenu();
        break;

      case 10:
        input.close();
        System.exit(1);

      case 99:
        // Debug
        // System.out.println(Stoichiometry.theoreticalYield("Na2S1 + (2)Ag1N1O3 ---> Ag2S1 + (2)Na1N1O3",
        // 3.94, 2, 1))
        break;

      default:
        // Start again
        mainMenu();
    }
  } // end mainMenu