realname now returns ok or error tuples:  does not use IO