changed approach to convert string into list of lines