fixed function to find zeros of polynomial