cross platform compatibility changes and adding some stocking functionality