Added vectorized and regularized costfunction for logistic regression