fix cont-frac procedure