Changed counting mechanisim to only count distinct dependencies