Final version of server program