change the internal representation of array to Data.IntMap