Adding the conditional to the names function