Added Logistic Regression, some refactoring