Updated to scale with data size