Actually keeping some state now, still buggy.