refactored and simplified pagination code
added divs to pagination in index.html