fixed bug in SETGATE while I don't know why.
lab4 finished (in hurry)