def fit_to_unit(data):
    """
    Shift and rescale `data` to fit unit interval.

    >>> rescale_x([5, 10, 15])
    [0.0, 0.5, 1.0]
    """
    head = data[0]
    data = [x - head for x in data]
    tail = data[-1:][0]
    return [x/float(tail) for x in data]