Fix curve bug. Increase acuracy. Remove some comments