Non-Square Arrays

Fixed for non-square arrays