implements local version of pagerank in scala