add DISCRETIZATION in upgraded algorithm