Fixed hardcoded numbers in Polyfit