got rid of unused index variable