         return Bool.random()
     }
 
-    public static func randomInt(_ range: Range<Int>) -> Int {
-        return Int.random(range)
-    }
-
+    public static func randomInt(range: Range<Int>) -> Int {
+        return Int.random(range: range)
+    }
+
+    public static func randomInt(lower: Int = 0, _ upper: Int = 100) -> Int {
         return Int.random(lower: lower, upper)
-    public static func randomInt(_ lower: Int = 0, _ upper: Int = 100) -> Int {
-    }
-
-    public static func randomInt32(_ range: Range<Int>) -> Int32 {
-				return Int32.random(range)
-    }
-
+    }
+
+    public static func randomInt32(range: Range<Int>) -> Int32 {
+				return Int32.random(range: range)
+    }
+
+    public static func randomInt32(lower: Int = 0, _ upper: Int = 100) -> Int32{
         return Int32.random(lower, lower: upper)
-    public static func randomInt32(_ lower: Int = 0, _ upper: Int = 100) -> Int32{
-    }
-
-    public static func randomPercentageisOver(_ percentage: Int) -> Bool {
+    }
+
+    public static func randomPercentageisOver(percentage: Int) -> Bool {
         return Int.random() > percentage
     }
 
-    public static func randomDouble(_ lower: Double = 0, _ upper: Double = 100) -> Double {
-        return Double.random(lower, upper)
-    }
-
-    public static func randomFloat(_ lower: Float = 0, _ upper: Float = 100) -> Float {
-        return Float.random(lower, upper)
-    }
-
-    public static func randomCGFloat(_ lower: CGFloat = 0, _ upper: CGFloat = 1) -> CGFloat {
-        return CGFloat.random(lower, upper)
-    }
-
-    public static func randomDateWithinDaysBeforeToday(_ days: Int) -> Date {
-        return Date.randomWithinDaysBeforeToday(days)
-    }
-
-    public static func randomDate() -> Date {
-        return Date.random()
-    }
-
-    public static func randomColor(_ randomAlpha: Bool = false) -> UIColor {
-        return UIColor.random(randomAlpha)
-    }
-
-    public static func randomNSURL() -> URL {
-        return URL.random()
+    public static func randomDouble(lower: Double = 0, _ upper: Double = 100) -> Double {
+        return Double.random(lower, lower: upper)
+    }
+
+    public static func randomFloat(lower: Float = 0, _ upper: Float = 100) -> Float {
+        return Float.random(lower, lower: upper)
+    }
+
+    public static func randomCGFloat(lower: CGFloat = 0, _ upper: CGFloat = 1) -> CGFloat {
+        return CGFloat.random(lower, lower: upper)
+    }
+
+    public static func randomDateWithinDaysBeforeToday(days: Int) -> NSDate {
+        return NSDate.randomWithinDaysBeforeToday(days: days)
+    }
+
+    public static func randomDate() -> NSDate {
+        return NSDate.random()
+    }
+
+    public static func randomColor(randomAlpha: Bool = false) -> UIColor {
+        return UIColor.random(randomAlpha: randomAlpha)
+    }
+
+    public static func randomNSURL() -> NSURL {
+        return NSURL.random()
     }
 
     //==========================================================================================================

        static let allValues = [Standard, MM, Identicon, MonsterID, Wavatar, Retro]
    }

    public static func createGravatar(_ style: Randoms.GravatarStyle = .Standard, size: Int = 80, completion: ((_ image: UIImage?, _ error: Error?) -> Void)?) {
        var url = "https://secure.gravatar.com/avatar/thisimagewillnotbefound?s=\(size)"
        if style != .Standard {
            url += "&d=\(style.rawValue.lowercased())"
        }

				let request = URLRequest(url: URL(string: url)! as URL, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 5.0)
        let session = URLSession.shared

        session.dataTask(with: request as URLRequest, completionHandler: {(data, response, error) in
            DispatchQueue.main.async {
                if error == nil {
                    completion?(UIImage(data: data!), nil)
                } else {
                    completion?(nil, error)
                }
            }
        }).resume()
    }

    public static func randomGravatar(_ size: Int = 80, completion: ((_ image: UIImage?, _ error: Error?) -> Void)?) {
        let options = Randoms.GravatarStyle.allValues
        Randoms.createGravatar(options.randomItem()!, size: size, completion: completion)
    }
}


    }
}

public extension NSURL {
    /// SwiftRandom extension
    public static func random() -> NSURL {
        let urlList = ["http://www.google.com", "http://leagueoflegends.com/", "https://github.com/", "http://stackoverflow.com/", "https://medium.com/", "http://9gag.com/gag/6715049", "http://imgur.com/gallery/s9zoqs9", "https://www.youtube.com/watch?v=uelHwf8o7_U"]
        return NSURL(string: urlList.randomItem())!
    }
}

