added 1 and 3 corner cases dtrinv