Replaced matrix and eye with sylvester, made load and sum, calculated the cost function of the training data