correctly draw curves