second method works