attempt at stack reconstruction