Added debug option
Added logging wrapper
Adapted logging to new wrapper function
Updated to include new logging technique
Added documentation for debug option