all functions calling random() are volatile