Add lineCount method and use it for the max  value of the gotoLine method