Implement a better way to determine the current line number