Added Linearization code