Rewrite of DTail. Hopfully better!