public static void main(String[] args) throws Exception {

		CmdLineParser cmd = new CmdLineParser();
		Option<String> modeOption = cmd.addStringOption('m', "mode");
		Option<String> loadPathOption = cmd.addStringOption('l', "loadPath");
		Option<String> storePathOption = cmd.addStringOption('s', "storePath");
		Option<String> filePathOption = cmd.addStringOption('f', "filePath");
		Option<Boolean> verboseOption = cmd.addBooleanOption('v', "verbose");
		Option<Integer> wImgOption = cmd.addIntegerOption('x', "imageWidth");
		Option<Integer> hImgOption = cmd.addIntegerOption('y', "imageHeight");
		Option<String> layerOption = cmd.addStringOption("hiddenLayers");
		Option<String> learningRuleOption = cmd.addStringOption('r',
				"learningRule");
		Option<Boolean> licenseOption = cmd.addBooleanOption("license");
		Option<String> paramOption = cmd.addStringOption('p', "param");
		Option<Double> lowOption = cmd.addDoubleOption("lo");
		Option<Double> highOption = cmd.addDoubleOption("hi");
		Option<Double> stepOption = cmd.addDoubleOption("st");
		Option<Integer> neuronsOption = cmd.addIntegerOption("nr");
		Option<Integer> setsizeOption = cmd.addIntegerOption("sz");
		cmd.parse(args);

		String mode = cmd.getOptionValue(modeOption, "tell");
		String loadPath = cmd.getOptionValue(loadPathOption);
		String storePath = cmd.getOptionValue(storePathOption);
		String filePath = cmd.getOptionValue(filePathOption);
		boolean verbose = cmd.getOptionValue(verboseOption, false);
		int width = cmd.getOptionValue(wImgOption, 0);
		int height = cmd.getOptionValue(hImgOption, 0);
		String layers = cmd.getOptionValue(layerOption);
		String ruleString = cmd.getOptionValue(learningRuleOption);
		boolean license = cmd.getOptionValue(licenseOption, false);
		Double  low = cmd.getOptionValue(lowOption);
		Double high = cmd.getOptionValue(highOption);
		Double step = cmd.getOptionValue(stepOption);
		String param = cmd.getOptionValue(paramOption);
		Integer neuronsInLayer = cmd.getOptionValue(neuronsOption, null);
		int setSize = cmd.getOptionValue(setsizeOption, -1);
		// distinguish between modes
		if (mode.compareTo("al") == 0) {
			// the code is running in constructor
			new NeuroAnalytics(loadPath, low, high, step, param, neuronsInLayer, setSize, verbose);
		}
		else {
			NeuroNumber app = new NeuroNumber(mode, loadPath, storePath, filePath,
					verbose);
			if (license) {
				app.printLicense();
				return;
			}

			if (width > 0 && height > 0) {
				app.setDimensions(width, height);
			}
			if (layers != null) {
				app.setLayers(layers);
			}
			if (ruleString != null) {
				app.setLearningRule(ruleString);
			}
			app.run();
			}
	}