Add sigmoid function and complete basic Cost function