changes to get it running again, also add comments to tell source of thirdparty stuff