added option to choose output