Made cc a server and coded some logic