Minor modification to include log in main.