main method added to allow running from command line