added --time and --module options and generally cleaned up code options