Initial curve drawing code