add bit swap code