added linelength.js and refactored readlingleftarrow and localised some
variables