Porting client.ml