Cleaned up code and added ability for multiple file upload.