Added a new type to handle row lengths
Better implementation for reverseRounds function