Corrected to use cells index