added server/client mode settings. restructured other stuff, not working