added functionality to ml_utils.py