Refractored block into a method
moved n=2 into that block

I did this so that the code would be a little more readable. That way
the method's name explains what that block is doing, rather than
explaining it with comments.

I also moved n=2 into this block of code because it's easier to read if
the variable is declared right before it's used.

I know that the code should be refractored in a way that the reader
could understand it by reading top down but this is very difficult.
Changed RR and CC
gave variables more descriptive name
Moved code to method

I put a block of code in a separate method called formatToPrint so that
the name of the method would explain what the block of code was doing so
that there was no need for comments. This increases readability.