added machine learning functions