added option to print to console