changes so it works with more than the first page