adding a get_bit method and tests
optimizing code
+comment