bit operations may be working? need to check against other version
still trying to find bug