bugfixes, getNumLines function