Moved the tracking bucket under the loop scope
Removed the unnecessary array slicing