Added ugly determinant; changed trace