final version of function plus upload of project files