Simplified main function using more flags.