changing return value for lines method in class String