Work in progress - BitEncoder.py