attempting again to put everything into a single script