Added docstring, comments and test for bits.