Writing results
fixed merging