Better naming algorithm