def find_free_place(places_available, desired_place):
    """
    Find place in sequence that is available and nearby.

    This function checks if desired_place is in the list of places that are still available and returns
    desired_place if so. If not, it returns the closest, higher place that is. If there are no higher ones,
    it returns the lowest place in places_available.

    :param places_available: sorted list of places in the sequence that are still available
    :param desired_place: place to check
    :return chosen place
    """
    if desired_place in places_available:
        places_available.remove(desired_place)
        return desired_place

    for k in places_available:
        if k > desired_place:  # assuming places_available is sorted
            places_available.remove(k)
            return k

    chosen_place = min(places_available)
    places_available.remove(min(places_available))
    return chosen_place