replaced kron with tensor where appropriate