fix initial bitwise operations
tediously move all BB setup code from Ruby to C...