Finally works on more than two elements not sure how it will handle arrays yet.

Made the FileText have a larger scope so I don't have to worry about
passing it between methods.