Now we're counting properlyish. There's a few off by one errors. I'll fix those later.