Added some debug in main, and some conditionals to run.