only check diagonal if needed