Fixed duplicate variable

"r" was used to represent row inside functions, as well as the color red.