Reworking the pagination so it works with Foundation