Remove left over gate code from main, add a more detailed note on toposort to indicate what was changed