Better range distribution and division test implementation