code cleanup
Added command line argument parser