beginnings of discretizer fn