Correct order of parameters when creating a Curve
Convert source code to be able to run both on python2 and python3