Re-implement toString with foldLeft