adding out option for writing files