tweaked to make stacking correct