newHive.py first working copy (only tested with python)