modify stack layout to work with series of unequal lengths