Fixed the issue with memory, used glushort to contain the indexes, since there are more than 256 indexes, glushort was not enough, so using glint, now a lot more # of indexes can be stored.