edit outcode function to use bitwise or