Adding functionality to the names function