Introduced temporary variables to hold array, length, and index.