calculate for each file, instead of module