Added negative page rank test, code refactored as well