Sequential version of the Pagerank implementation