main() and run() now behave correctly