removed else statement, likely screwing up the swap