Modified Server and Client main