added support for line grouping