Added argument parsing and logging