updated bit functions