added flatten function to .bashrc