added code to allow main() to run from command line