functional script