almost-done script. not tested