move majority of functionality into .bashrc