add compile() to LineGraph and BezierGraph. add comments.