added first draft of global stock handling