Rewrote to use Scanner instead of JOptionPane