improved toString implementation