Gate class now extends Thread and updates itself forever.