adds a method for conuting lines in a file