working version of swapcase in C