polynomial distribution bug fix