some new bit manipulations