use sparseArray to replace Maps with integer keys