Completed implementation of file to array