I believe this can be more succinctly expressed as `for j in reversed(range(i))`.