Make it into a proper command line script