added ModeArray struct, and Add and Remove functions using realloc (haven't tested yet)