Builds a polynominal from array