         }
 
     }
+    
+    func getFormattedURL(index: Int) -> String {
+        
+        var storyURL = dataArr[index].valueForKey("url") as? String
+        
+        if storyURL == nil {
+            storyURL = "https://news.ycombinator.com/item?id=" + String(dataArr[index].valueForKey("id")!)
+        }
+        
+        storyURL! = storyURL!.stringByReplacingOccurrencesOfString("http://", withString: "")
+        storyURL! = storyURL!.stringByReplacingOccurrencesOfString("https://", withString: "")
+        storyURL! = storyURL!.stringByReplacingOccurrencesOfString("www.", withString: "")
+        
+        return storyURL!
+    }
 
     func numberOfSectionsInTableView(tableView: UITableView) -> Int {
         return 1

        return dataArr.count
    }
    
    func getURL(index: Int) -> String {
        
        var storyURL = dataArr[index].valueForKey("url") as? String
        
        if storyURL == nil {
            storyURL = "https://news.ycombinator.com/item?id=" + String(dataArr[index].valueForKey("id")!)
        }
        
        return storyURL!
    }

    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

        var cell = tableView.dequeueReusableCellWithIdentifier(mainTableViewCellIdentifier)
        
        if cell == nil {
            cell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: mainTableViewCellIdentifier)
            cell!.textLabel?.numberOfLines = 3
            cell!.detailTextLabel?.numberOfLines = 3
            cell!.detailTextLabel?.textColor = UIColor.grayColor()
        }
        
        cell!.textLabel?.text = dataArr[indexPath.row].valueForKey("title") as? String
        cell!.detailTextLabel?.text = getFormattedURL(indexPath.row)
        
        return cell!
    }
