updated code with pagerank sample