Updated with console writes