Fixed the issue where it was breaking at the end, updated the weights, and added line to save the final tfidf matrix to file for use with python.