'Improving' on stack answer