Fixed issue with equal dimensions, different method of looping