use bits

I have not tested this commit, sorry.
Merge pull request #12 from arichnad/master

use bits