adjusting discretization algorithm