replaced HashMap<Long, Integer> with LongSparseArray