Fix up lines to be in groups instead of individually