Added option to capture print output