add trimsr and new Jacaobian matrix