starting to modularize script