added name-getting as a function