working version of pagerank