wrote polynomial func to be used for upcomming logistic regression example