combined client and server, added flags but they be broke