I've put res[0] instead of res[i] in a for loop stupid baka me