             titleLabel.textColor = NSColor.gray
         }
 
-
-//        let position = SpotifyAppleScript.currentTrack.positionPercentage
-//        positionSlider.doubleValue = floor(position * 100)
-
-        updateTime(track: track)
-    }
-    
-    // MARK: - Private methods
-    
-    fileprivate func updateTime(track: MusicTrack?) {
-        if let track = track {
-//            let leftTimeTuple = secondsToHoursMinutesSeconds(seconds: track.position)
-//            leftTime.stringValue = getTimeString(tuple: leftTimeTuple)
-            
-            
-            switch rightTimeIsDuration {
-            case true:
-                let rightTimeTuple = secondsToHoursMinutesSeconds(seconds: track.duration/1000)
-                rightTime.stringValue = getTimeString(tuple: rightTimeTuple)
-            case false: break
-//                let rightTimeTuple = secondsToHoursMinutesSeconds(seconds: track.duration - track.position)
-//                rightTime.stringValue = "-" + getTimeString(tuple: rightTimeTuple)
-            }
-        }
+        updateTime()
+    }
+    
+    fileprivate func updateTime() {
+        let leftTimeTuple = secondsToHoursMinutesSeconds(seconds: self.position)
+        leftTime.stringValue = getTimeString(tuple: leftTimeTuple)
+        
+        switch rightTimeIsDuration {
+        case true:
+            let rightTimeTuple = secondsToHoursMinutesSeconds(seconds: self.duration)
+            rightTime.stringValue = getTimeString(tuple: rightTimeTuple)
+        case false:
+            let rightTimeTuple = secondsToHoursMinutesSeconds(seconds: self.duration - self.position)
+            rightTime.stringValue = "-" + getTimeString(tuple: rightTimeTuple)
+        }
+        
     }
 
     private func updateButton(state: MusicPlaybackState?) {

            self.musicPlayerManager.add(musicPlayer: MusicPlayerName.spotify)
            self.musicPlayerManager.add(musicPlayer: MusicPlayerName.iTunes)
        }
        self.musicPlayerManager.delegate = self
    }
    
    // MARK: - Public methods
    

    func updateInfo(track: MusicTrack?) {
        if let track = track {
            if let artworkUrl = track.artworkUrl , artworkUrl != lastArtworkUrl {
                self.artworkImageView.downloadImage(url: URL(string: artworkUrl)!)
                lastArtworkUrl = artworkUrl
            }
            if track.artworkUrl == nil {
                artworkImageView.image = defaultImage

    
    @IBAction func openSpotify(_ sender: Any) {
        self.musicPlayerManager.currentPlayer?.activate()
    }
    
    @IBAction func positionSliderAction(_ sender: AnyObject) {
        self.position = (positionSlider.doubleValue/100.0)*self.duration
        self.musicPlayerManager.currentPlayer?.playerPosition = self.position
    }
    
    @IBAction func togglePlay(_ sender: AnyObject) {
