Get rid of unecessary intermediate variables.
Get rid of unecessary bits counting code.