script to tie everything together