update util.py, added random sub-set selection