added support for named if and do constructs