curve.h was fixed and function length was added