reading this it isn't clear to me at all when the `|| 0` kicks in; the page index isn't a truth value, it's an integer. Feels like we're relying on some JavaScript wat.