small change
dont need

pretty sure i don't need that because i set previous_id_array[index] =
id_array[index] at the end of the loop