refactor
implemented line-based contour (i.e. polygon)