replace stacks alignment script