adapted script to fit structure of actual data
OS script redone locally on OS computer due to trigger issues, will be uploaded later