corrected multiple errors for .random() method