Initial handling of circular lists
Move helper functions inside toString