Rename variable in loop:
rev -> curr_rev.