Updated Client and Server code