implemented line click, added index to preview lines (unfinished)