uploadCode function coded