fixed obvious typo in polynomial and optimized expression