Converted to maven, finished cost function, and added regularization