Improved toString method with fold