add another missing 0-padding - also related to #1
relocate functions in beacon.py