Moved script into gadget.