implements #random class method