implemented Simulator and Client.