Added commandline parameters, errorhandling