added generalized extract function to bashrc