     }()
 
     lazy var ticker: TickCounter = {
+        let realm = try! Realm()
         let ticker = TickCounter()
-        try! self.realm.write {
-            self.realm.add(ticker)
+        try! realm.write {
+            realm.add(ticker)
         }
         return ticker
     }()

    override func viewDidLoad() {
        super.viewDidLoad()

        laps = realm.objects(Lap.self).sorted(byKeyPath: "time", ascending: false)

        /*
         Observable<Results<Lap>> - wrap Results as observable
         */
        Observable.from(laps)
            .map {results in "laps: \(results.count)"}
            .subscribe { event in
                self.title = event.element

//view controller
class ViewController: UIViewController {
    let bag = DisposeBag()

    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var tickItemButton: UIBarButtonItem!
    @IBOutlet weak var addTwoItemsButton: UIBarButtonItem!
