Writing to Result file