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