         self.update()
     }
     
-    private func start() -> UInt64 {
-        let msSinceLastLocationFix = UInt64.random(200, max: 300)
-        self.api.Settings.LocationFixes = [generate(UInt64.random(500, max: 750)),
-                                           generate(UInt64.random(350, max: 450)),
-                                           generate(msSinceLastLocationFix)]
-        return msSinceLastLocationFix
+    private func generateByCount(startAt: Int) {
+        let minFloor = floor(500/Double(self.api.locationFix.count))
+        let maxFloor = floor(750/Double(self.api.locationFix.count))
+        
+        for i in startAt..<self.api.locationFix.count {
+            let minValue:UInt64 = 500 - (UInt64(minFloor) * UInt64(i))
+            let maxValue:UInt64 = 750 - (UInt64(maxFloor) * UInt64(i))
+            
+            let newFix = generate(UInt64.random(minValue, max: maxValue))
+            self.api.locationFix.builders.append(newFix)
+        }
+    }
+    
+    private func getTimeSnapshot() -> UInt64 {
+        return self.api.getTimestamp() - self.api.locationFix.lastTimesnap
+    }
+    
+    private func getLastTimeSnapshot() -> UInt64 {
+        return self.api.locationFix.builders.last!.timestampSnapshot
     }
     
     private func update() {
-        var lastLocFix:UInt64 = 0
-        if self.api.Settings.LocationFixes.count == 0 {
-            lastLocFix = start()
-        } else {
-            if self.api.Settings.LocationFixes[0].timestampSnapshot + 1000 < self.api.getTimestamp() {
-                self.api.Settings.LocationFixes[1].timestampSnapshot += self.api.getTimestampSinceStart()
-                self.api.Settings.LocationFixes[2].timestampSnapshot += self.api.getTimestampSinceStart()
-                lastLocFix = UInt64.random(200, max: 300)
-                self.api.Settings.LocationFixes.removeFirst()
-                self.api.Settings.LocationFixes.append(generate(lastLocFix))
-            } else {
-                self.api.Settings.LocationFixes[0].timestampSnapshot += self.api.getTimestampSinceStart()
-                self.api.Settings.LocationFixes[1].timestampSnapshot += self.api.getTimestampSinceStart()
-                self.api.Settings.LocationFixes[2].timestampSnapshot += self.api.getTimestampSinceStart()
-                lastLocFix = self.api.Settings.LocationFixes.last!.timestampSnapshot
+        self.api.locationFix.lastTimesnap = self.api.getTimestamp()
+        if self.api.locationFix.builders.count == 0 {
+            generateByCount(0)
+        } else {
+            var countRemoved = 0
+            for i in 0..<self.api.locationFix.count {
+                self.api.locationFix.builders[i].timestampSnapshot += getTimeSnapshot()
+                if self.api.locationFix.builders[i].timestampSnapshot < 1500 {
+                    countRemoved += 1
+                }
             }
-        }
-        self.timestamp = lastLocFix
+            self.api.locationFix.builders.removeRange(Range(start: 0, end: countRemoved))
+            generateByCount(self.api.locationFix.count - countRemoved)
+        }
+        self.api.locationFix.timestamp = getLastTimeSnapshot()
     }
     
     private func generate(timeStamp: UInt64) -> Pogoprotos.Networking.Envelopes.Signature.LocationFix.Builder {
         let locFix = Pogoprotos.Networking.Envelopes.Signature.LocationFix.Builder()
         locFix.provider = "fused"
-        locFix.timestampSnapshot = timeStamp
+        locFix.timestampSnapshot = self.api.getTimestampSinceStart() + timeStamp
         locFix.latitude = Float(self.api.Location.lat) + Float.random(min: -0.01, max: 0.01)
         locFix.longitude = Float(self.api.Location.long) + Float.random(min: -0.01, max: 0.01)
         locFix.altitude = Float(self.api.Location.alt) + Float.random(min: -0.01, max: 0.01)

import Foundation


internal class LocationFix {
    internal var timestamp:UInt64 = 0
    private let api: PGoApiRequest
    
    internal init(api: PGoApiRequest) {

    }
    
    private func getLocationFixes() -> [Pogoprotos.Networking.Envelopes.Signature.LocationFix] {
        var fixes: [Pogoprotos.Networking.Envelopes.Signature.LocationFix] = []
        for i in 0..<self.api.locationFix.count {
            fixes.append(try! self.api.locationFix.builders[i].build())
        }
        return fixes
    }
    
    internal func build() -> Pogoprotos.Networking.Envelopes.RequestEnvelope.PlatformRequest {
