Refactored to make logger and options globals
Main program for the pipeline