Small changes to get a version that is actually reducing error on the training set.