set toString() to output formatted output

See #169

Does this implementation looks OK to you? I'll happily change it if you had something else in mind.