further speed improvements
do not count files with multiple parents as different files