Added client/server stuff and decision code