update subset.py

finish closure function