changed some stuff in the client class, still needs a heavy clean up though