final python function.
python function done.