diff --git a/GenCompiler.java b/GenCompiler.java
index aa8e1435b1b2fb522f25e6a8e1ab3fba8f79be99..084bba2f5902f83a65d4c390eff212ab03e2e248 100644
--- a/GenCompiler.java
+++ b/GenCompiler.java
@@ -12,37 +12,56 @@ import java.io.PrintStream;
 
 public class GenCompiler extends Parser {
 	public static void main(String args[]) {
-		Start ast = parse(args);
 
-		File siarasDir = new File("x3d");
+        String dir = "x3d";
+        String outName = "x3d";
+        String[] schema = new String[1];
+        boolean first = true;
+
+        for (int i=0; i<args.length; i++) {
+            if (args[i].equals("-d")) {
+                dir = args[++i];
+            } else if (args[i].equals("-o")) {
+                outName = args[++i];
+            } else {
+                // OK, we suppose the remaing arg to be parsed.
+                schema[0] = args[i++];
+            }
+        }
+
+
+		Start ast = parse(schema);
+
+		File siarasDir = new File(dir);
 		if (!siarasDir.isDirectory()) {
 			siarasDir.mkdir();
 		}
 		
 		String fileName = null;
+        String common = dir+File.separator+outName;
 		try {
 			// Generate JastAdd abstract grammar
-			fileName = "x3d/x3d.ast";
+			fileName = common+".ast";
 			PrintStream pStream = new PrintStream(new File(fileName));
 			ast.genAbsGrammar(pStream);
 
 			// Generate JavaCC input
-			fileName = "x3d/x3d.jjt";
+			fileName = common+".jjt";
 			pStream = new PrintStream(new File(fileName));
 			ast.genJavaCC(pStream);
 
 			// Generate Parser.java
-			fileName = "x3d/Parser.java";
+			fileName = dir+"/Parser.java";
 			pStream = new PrintStream(new File(fileName));
 			ast.genParser(pStream);
 
 			// Generate PrettyPrint.java
-			fileName = "x3d/PrettyPrint.java";
+			fileName = dir+"/PrettyPrint.java";
 			pStream = new PrintStream(new File(fileName));
 			ast.genPrettyPrint(pStream);
 
 			// Generate aspects
-			fileName = "x3d/GeneratedAspects.jrag";
+			fileName = dir+"/GeneratedAspects.jrag";
 			pStream = new PrintStream(new File(fileName));
 			ast.genAspects(pStream);
 
diff --git a/README b/README
new file mode 100644
index 0000000000000000000000000000000000000000..e0379c317879b4caa45b3ffeea9cb539a0d458d9
--- /dev/null
+++ b/README
@@ -0,0 +1,32 @@
+
+
+ABOUT
+
+The main purpose of the Schemacompiler is to automatically generate
+compiler front-ends for different XML dialects. Given an XML schema,
+the schemacompiler will generate an abstract grammar and some aspect
+code for JastAdd, as well as a JavaCC parser description. The
+generated compiler may then be extended with more aspects, and
+possibly new abstract grammar rules, to form a complete compiler.
+
+
+USAGE
+
+$ java GenCompiler [-d dir] [-o outfile] schema
+
+options:
+        -d dir          directory where generated files are put. 
+                        Will be created if not already exists.
+                        Default is 'x3d'.
+                        
+        -o outfile      Name for generated grammar files.
+                        Default is 'x3d'.
+
+'$ java GenCompiler examples/x3d-3.0.xsd' will generate a compiler for
+x3d in the x3d subdirectory. x3d/build.xml should be studied as an
+example on how to use the generated code.
+
+
+AUTHOR
+
+Anders Nilsson <anders.nilsson@cs.lth.se>
\ No newline at end of file