Made changes to allow ml module to work with big data.