added log method that takes a string
Logging each output for every 5 calls to the log method