Converted main function into a testbed.