adding curve code