Finalized the 2nd polynomial code