added new method to count new lines in string