working gauss, but only for 1 value of p