def returnListWithoutOutliers(data, outlierRange):
    """
        An outlier is defiend as a datapoint not in [Q1 - 1.5*IQR*outlierRange, Q3 + 1.5*IQR*outlierRange],
        where IQR is the interquartile range: Q3 - Q1
    """
    data.sort()

    dataPointsBefore = len(data)
    Q1 = data[dataPointsBefore//4]
    Q3 = data[3*dataPointsBefore//4]
    IQR = Q3 - Q1

    lowerFence = Q1 - 1.5 * IQR * outlierRange
    upperFence = Q3 + 1.5 * IQR * outlierRange

    filteredData = [i for i in data if i >= lowerFence and i <= upperFence]

    dataPointsAfter = len(filteredData)
    print('Removed ' + str(dataPointsBefore - dataPointsAfter) + ' outliers')

    return filteredData