discretized version