reverted misc.py to master version