def compute_points(purchase):
    if purchase < 10:
        points = 1
    else:
        points = int(purchase)//5 * 3
        if purchase >= 1000:
            points = points + 50
    return points

def update_points (accum_points, purchase):
    return accum_points + compute_points(purchase)
