Hacky but working pagination