improved install script to use a function so things get isntalled cleaner