graphs and finished functional script