switched to j in range len style for loop