public static List<Int64> RemoveOutliers(Int16 carId, Int64 tripId)
        {
            List<Fact> facts = new List<Fact>();

            DBController dbc = new DBController();
            facts = dbc.GetFactsByCarIdAndTripId(carId, tripId);
            dbc.Close();

            List<Int64> OutlierIds = new List<Int64>();

            for (int i = 1; i < facts.Count(); i++) {
                double distanceTravelled = facts[i].Spatial.MPoint.GetDistanceTo(facts[i - 1].Spatial.MPoint);
                double currentSpeed = Math.Max(facts[i].Measure.Speed, facts[i - 1].Measure.Speed) + 15;
                currentSpeed = currentSpeed * 3.6;

                if (distanceTravelled / (facts[i].Temporal.Timestamp - facts[i - 1].Temporal.Timestamp).TotalSeconds > currentSpeed || facts[i].Temporal.Timestamp == facts[i - 1].Temporal.Timestamp) {
                    OutlierIds.Add(facts[i].EntryId);
                }
            }

            if (OutlierIds.Count > facts.Count * 0.1) {
                //Console.WriteLine(tripId + " is invalid");
            }

            return OutlierIds;
        }