changed split_lines to use array