minor changes + adding a function to get the available free stack