fixing line strip, sorting and line length