added header/globals to materialdestroyed program