Rewrite readlines to store lines in an array supplied by main, rather than calling alloc to maintain storage