Use another scratch variable here and for the min and max points below and clone `tempPoint` to them.