Fixing spiral matrix when difference between rows and cols is larger than 2 or 3