Re-added name formatting function