Cleanup imports in unit.py
Add some comments
Fix hash issue in python 3. (hopefully)