Merge pull request #8 from ajy/master

working upload, with conflicts resolved
moved upload function to correct location