Updated thor script