hlevel.py has been completly rewritten