Fixes #3 : add gates a secodn time

Awesome job! Go ahead and merge this back into master.