Implementing some basic numerical optimization techniques.