serial stack by @mmaroti Faster and smaller then the current one