script finally works