Added from_yaml method