Changed upload code to use gists