improved algo, +gauss/gamma