added saving of output samples..