Write to output file; get rid of unused dependencies