improved uniform() callback