Convert to using lists for speed