Instead of this, put the str += on the LHS of the ternary, ie,

```ruby
str += cons?(self.car) ? self.car.to_s : atom_string(self.car)
```