added glue.py: general control flow in there