further work on stack stuff