smarter script