add a line selection function