Update on upload method. Removed some unused stuff.