Renamed Array2D.indexOf to toIndex for more consistent naming.