Most of a script, requires testing.