Finished first version of machine learning