hooking up line index logic