added csv functionality, implemented argparse with optional arguments instead of sys.argv
added csv functionality, implemented argparse with optional arguments instead of sys.argv