Create function curves properly (2/2)

Watch out for bug with big numbers