added new write to console function