Dynamic discretization