Updated based on Gil's suggestion.