Added file upload, tweaked for refinement