New algorithms and some tinkering in Stack files