Added the optparse and logging