Almost completed pagination(). Need to fix bug with last pages