Thank you very much! That helped, because I found out that the letters where shuffled to EDCBA, and then shuffled back to ABCDE. So I just said that:

for (int i = 0; i < (b-((b+1)/2)); i++)

because odd number/2 will be rounded down, this works!

Maybe not the best way to do it in a programmers view, but it worked