Got pagination going alright, starting to get a bit messy mixing flat files with db