added Global constraints and digital io refactor