Testing different implementations of algortihm. Currently does not converge