successful random implementation