improvements to dls and stack