Trying to make reading input function.

I cannot get the input to be read into an array without throwing some
error. All the recursion methods work as I tested with a fixed array.