copied over a bunch of helpful scripts written previously;