Added command line arguments and set up functions for export