project 1, part 2: calculating in-degrees