Commit StudyUpload: Refined algo