The Magic of Opening and Closing Gates and its Application page 5 full