added option to only write out files that have unused dependencies