Added Curving code