Added System.exit since the main class was moved to separate methods.