V2 code
adapting to new V2 upload system