Updated to work from command line. Pass your rules as arguments.