renamed to server and changed code