some comments to minimized stack usage