Fixed up the step-size calculation in the gradient fill functions. They weren't properly dividing by the number of times you'll step (which is the difference in position MINUS ONE.