As we discussed offline, x is still possible less than 0 or more than 1, so let's keep these logic to avoid miscalculating.