Added logic to calculate hits and pagerank scores