added rendering of curved lines, code cleanup