adding ability to define sample header with writer