moved around the uploads function, still a mess though