all console.log calls changed to use option.logging parameter.