update better equivalent function