modified the gls-function, added multifurcation as a standard