work on ellipse function