Solution for swapcase problem