Adding a --debug switch to enable logging