thesis when writing a paper