completely redesigned background location tracking algorithm