cleaned up code, added name = main, trying to fix logging stuff