some helpful bit operations