rewrite the function inName()

rewrite the function inName()