swap and print working