added a decent-ish impl. need to flesh out the pagination decisions thing