hedge.py modified