cleaned up the curve function and toString method.