Removed repeated item
Writing out as object and text string
bug fixes