Sort of fixed things, get a weird exception where the index is out of the bounds when it isn't.